/**
* @file globals.h
* @author Jan Sliacky
*
* Global constants and structures
*
* April 2010
*
* Copyright (c) 2009 by Jan Sliacky
* All rights reserved.
*/

#ifndef GLOBALS_H_
#define GLOBALS_H_

#define RANDOMFALLSCOUNT 20			/* Count of generated fall times 				*/
#define MAXPROCCOUNT 50				/* Maximal number of processors					*/
#define MAXTASKCNT 1000				/* Maximal number of tasks						*/
#define MINFALLTIME 0.01			/* Minimal time to fall							*/
#define MINDURTIME 0.01				/* Minimal time of fall duration				*/
#define MINTASKCOMPLEXITY 0.01		/* Minimal task complexicity					*/
#define FALLWAITSTEP 0.1			/* Step between checking waitCondition variable */

enum log_level_type
{
    trace,
    debug,
    msg,
    info,
    error,
    none,
    no_level,
};

enum tasks_amount
{
    one,
    npart,
    all,
    no_amount,
};

typedef struct {
    char *sourceFile;				/* source file to complement missing parameters */
    char *outputFile;				/* output file									*/
    int nProcs;						/* number of processors							*/
    int nTasks;						/* number of all tasks							*/
    int nHwCores;					/* number of processors cores in PC				*/
    double latency;					/* latency of sending messages					*/
    enum tasks_amount amount;		/* amount of task sends by load balancing		*/
    int forgetStatuses;				/* forgets statuses of all tasks after fall		*/
    int takeAll;					/* takes all unassign tasks without agreement	*/
    float muTasks;					/* tasks mu variable of normal distribution		*/
    float sigTasks;					/* tasks sigma variable of normal distribution	*/
    float muFallDur;				/* duration mu variable of normal distrib.		*/
    float sigFallDur;				/* duration sigma variable of normal distrib.	*/
    float muFallProb;				/* processor fall mu variable of normal distrib.*/
    float sigFallProb;				/* processor fall sigma variable of normal dist.*/
    float sigNextFall;				/* falls sigma variable of normal distribution	*/
    enum log_level_type logLevel;	/* log level */
    float procFallProbs[MAXPROCCOUNT];
    float fallProbs[MAXPROCCOUNT][RANDOMFALLSCOUNT];
    float fallDur[MAXPROCCOUNT][RANDOMFALLSCOUNT];
    float tasksArray[MAXTASKCNT];
}
init_config;

typedef struct {
    char *inputdir;					/* TODO */
    char *tex_file;					/* TODO */
    _Bool make_pdf;					/* TODO */
}
stats_config;

#endif /* GLOBALS_H_ */
